# $Id: PKGBUILD 86933 2013-03-25 01:19:53Z seblu $
# Maintainer: Sébastien Luttringer
# Contributor: Chris Brannon <chris@the-brannons.com>
# Contributor: Mark Smith <markzzzsmith@yahoo.com.au>

pkgname=ndisc6
pkgver=1.0.2
pkgrel=6
pkgdesc='Collection of IPv6 networking utilities'
arch=('i686' 'x86_64')
url='http://www.remlab.net/ndisc6/'
license=('GPL')
depends=('glibc' 'perl')
makedepends=('glibc' 'gcc')
options=(!emptydirs)
install=ndisc6.install
source=("http://www.remlab.net/files/ndisc6/$pkgname-$pkgver.tar.bz2"
	      'rdnssd.service')
md5sums=('50cb4c19606cf6ff2b7388e71832f579'
         'beeb4f033e9eb951e2de962f609c7c2a')

build() {
  cd $pkgname-$pkgver
  # patch invalid path
  sed -ri 's,PATH=/sbin:/bin,PATH=/sbin:/bin:/usr/sbin:/usr/bin,' rdnssd/merge-hook.in
  ./configure --localstatedir=/var --sysconfdir=/etc --prefix=/usr
  make
}

package() {
  cd $pkgname-$pkgver
  make DESTDIR="$pkgdir" install
  install -Dm644 "$srcdir/rdnssd.service" "$pkgdir/usr/lib/systemd/system/rdnssd.service"
  install -Dm644 /dev/null "$pkgdir/usr/lib/tmpfiles.d/$pkgname.conf"
  echo 'd /run/rdnssd 0755 nobody root' > "$pkgdir/usr/lib/tmpfiles.d/$pkgname.conf"
}

# vim:set ts=2 sw=2 et:
